import { getStorageSync, removeStorage, setStorage } from "@tarojs/taro";
class Storage {
    constructor() {
    }
    get(key) {
        return getStorageSync(key);
    }
    set(name, value) {
        return new Promise(resolve => {
            setStorage({
                key: name,
                data: value,
                success: () => {
                    resolve(true);
                },
                fail: () => {
                    resolve(false);
                }
            }).then(() => {
            });
        });
    }
    remove(key) {
        return new Promise(resolve => {
            removeStorage({
                key,
                success: () => {
                    resolve(true);
                }
            }).then(() => {
            });
        });
    }
}
export default new Storage();
